-
Notifications
You must be signed in to change notification settings - Fork 17
fix: Update poll choice name in confirmation text #496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Update poll choice name in confirmation text #496
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug in the vote confirmation modal where governance poll choices were mapped incorrectly. The mapping for poll choices has been corrected so that choiceId 0 now displays "Yes" and choiceId 1 displays "No" in the transaction confirmation, aligning with the actual vote buttons and the PollChoice enum.
Changes:
- Updated the poll choice name mapping in the VoteButton's
useHandleTransactionhook from{ 0: "No", 1: "Yes" }to{ 0: "Yes", 1: "No" } - Added clarifying comments distinguishing between TreasuryVoteSupport (for treasury proposals) and PollChoice (for governance polls)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@Jipperism |
The component is re-used, but the logic for treasury proposals is separate and looks correct already: https://github.com/livepeer/explorer/blob/main/components/VoteButton/index.tsx#L69 |
This pull request makes a minor update to the vote button
useHandleTransactionlogic to ensure that the correct choice name is displayed in the transaction confirmation modal.0now maps to "Yes" and1to "No", aligning with the expected order for PollChoice.